GtkFileChooserDefault *impl);
static void location_switch_to_path_bar (GtkFileChooserDefault *impl);
+static void stop_loading_and_clear_list_model (GtkFileChooserDefault *impl,
+ gboolean remove_from_treeview);
static void search_stop_searching (GtkFileChooserDefault *impl,
gboolean remove_query);
static void search_clear_model (GtkFileChooserDefault *impl,
if (impl->browse_path_bar_size_group)
g_object_unref (impl->browse_path_bar_size_group);
- load_remove_timer (impl);
-
/* Free all the Models we have */
- if (impl->browse_files_model)
- g_object_unref (impl->browse_files_model);
-
+ stop_loading_and_clear_list_model (impl, FALSE);
search_clear_model (impl, FALSE);
recent_clear_model (impl, FALSE);
+ /* stopping the load above should have cleared this */
+ g_assert (impl->load_timeout_id == 0);
+
g_free (impl->preview_display_name);
g_free (impl->edited_new_text);
}
static void
-stop_loading_and_clear_list_model (GtkFileChooserDefault *impl)
+stop_loading_and_clear_list_model (GtkFileChooserDefault *impl,
+ gboolean remove_from_treeview)
{
load_remove_timer (impl); /* This changes the state to LOAD_EMPTY */
impl->browse_files_model = NULL;
}
- gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), NULL);
+ if (remove_from_treeview)
+ gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), NULL);
}
static char *
profile_start ("start", NULL);
- stop_loading_and_clear_list_model (impl);
+ stop_loading_and_clear_list_model (impl, TRUE);
set_busy_cursor (impl, TRUE);
- gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view), NULL);
impl->browse_files_model =
_gtk_file_system_model_new_for_directory (impl->current_folder,
switch (mode)
{
case OPERATION_MODE_BROWSE:
- stop_loading_and_clear_list_model (impl);
+ stop_loading_and_clear_list_model (impl, TRUE);
break;
case OPERATION_MODE_SEARCH: